package com.xyq.system.controller.user;

import com.xyq.common.core.controller.BaseController;
import com.xyq.common.core.domain.Result;
import com.xyq.common.core.domain.TableDataInfo;
import com.xyq.system.domain.question.dto.QuestionSelectDTO;
import com.xyq.system.domain.question.vo.QuestionVO;
import com.xyq.system.domain.user.User;
import com.xyq.system.domain.user.dto.UserDTO;
import com.xyq.system.domain.user.dto.UserStatusDTO;
import com.xyq.system.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Autowired
    private UserService userService ;
    // B端获取用户列表
    @GetMapping("/list")
    public TableDataInfo list(UserDTO userDTO){
        List<User> list = userService.list(userDTO);
        return getTableList(list) ;
    }
  // 修改用户状态
    @PutMapping("/updateUserStatus")
    public Result updateUserStatus(@Validated UserStatusDTO userStatusDTO){
        return toResult(userService.updateUserStatus(userStatusDTO));
    }


}
